package com.ssy.jt808.gateway.client.exception;

import com.ssy.gaea.common.exception.BaseException;
import org.springframework.http.HttpStatus;

import java.util.Collections;

/**
 * @author zeno
 */
public class TerminalReplyException extends BaseException{

  /** http 状态码 */
  private final HttpStatus status;

  /** 异常状态码 */
  private final String code;


  public TerminalReplyException( String msg ){
    this(msg, Collections.emptyList());
  }

  /***
   *
   * @param msgPattern  java.text.MessageFormat 消息模板
   * @param msgArgs     java.text.MessageFormat 消息模板参数
   */
  public TerminalReplyException( String msgPattern, Object... msgArgs ){
    super(msgPattern, msgArgs);
    this.code = HttpStatus.FAILED_DEPENDENCY.name();
    this.status = HttpStatus.FAILED_DEPENDENCY;
  }

  @Override
  public String module(){
    return "Jt808-Terminal";
  }

  public HttpStatus status(){
    return status;
  }

  public String code(){
    return code;
  }
}
